package cn.dyp.com.agriculture;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;

/**
 * Created by lenovo on 2017/5/10.
 */

public class mEditText extends EditText {

    public mEditText(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public mEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public mEditText(Context context) {
        super(context);
    }

    @Override
    protected void onSelectionChanged(int selStart, int selEnd) {
        super.onSelectionChanged(selStart, selEnd);
        //保证光标始终在最后面
        if (selStart == selEnd) {//防止不能多选
            setSelection(getText().length());
        }
    }
}
